# -*- coding: utf-8 -*-

from events import *

event = Blueprint('index_event', __name__)

@event.route('/')
@event.route('/index', methods = [HTTP_METHOD_GET])
def landing_page():
    jsonResult = {
        data:2048
    }

    return render_template('/index/index.html', total_miles = jsonResult["data"], user_info = user)
    #return baseEvent.render_template('indexIndex','/index/index.html',total_miles = jsonResult["data"]["total_mile"])

@event.route('/about')
def about():
    return render_template('indexAbout','/index/about.html')

@event.route('/product')
def product():
    return render_template('indexProduct','/index/product.html')
    #return render_template('/index/product.html', user_info = __get_current_user())

@event.route('/setLanguage', methods = [HTTP_METHOD_POST])
def set_language_key():
    language_key = request.json['languageCode']
    response = index_op.set_language_key(language_key)
    response = make_response(response)
    response.set_cookie('__CookieLanguageKey',language_key)
    return response

